package function;

public class CopyofRange {
    public static void main(String[] args) {
        int[] arr = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
        int[] newarr = Copyofrange(arr, 3, 7);
        for (int i = 0; i < newarr.length; i++) {
            System.out.println(newarr[i]);
        }
    }

    public static int[] Copyofrange(int[] arr, int from, int to) {
        int[] newarr = new int[to - from];
        for (int i = from; i < to; i++) {
            newarr[i - from] = arr[i];
        }
        return newarr;
    }
}
